﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminSite.Master"
    Inherits="System.Web.Mvc.ViewPage<IceScream.ViewModels.ProductManagerViewModel>" %>
    <%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit product
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContent" runat="server">
    <h2>
        Edit product</h2>

    <form id="Form1" action="" enctype="multipart/form-data" method="post" runat="server">

    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Fields</legend>
        <div class="editor-label">
            <%: Html.Label("Category") %>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("sup_Product.IdCat", new SelectList(Model.lstCategory, "Id", "Name", Model.sup_Product.IdCat))%>
        </div>
        <div class="editor-label">
            <%: Html.Label("Name") %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.sup_Product.Name)%>
            <%: Html.ValidationMessageFor(model => model.sup_Product.Name)%>
        </div>
        <div class="editor-label">
            <%: Html.Label("Description") %>
        </div>
        <div class="editor-field">
               <CKEditor:CKEditorControl ID="Description" BasePath="~/Content/ckeditor" runat="server" 
                FilebrowserImageBrowseUrl= '/Content/ckfinder/ckfinder.html'
                FilebrowserImageUploadUrl= '/Content/ckfinder/core/connector/asp/connector.asp'
                FilebrowserBrowseUrl='/Content/ckfinder/ckfinder.html'
                FilebrowserUploadUrl='/Content/ckfinder/core/connector/asp/connector.asp'>
                    <%: Model.sup_Product.Description%>
               </CKEditor:CKEditorControl>
                <%: Html.ValidationMessageFor(model => model.sup_Product.Description)%>
            </div>

        <div class="editor-label">
            <%: Html.Label("Price") %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.sup_Product.Price)%>
            <%: Html.ValidationMessageFor(model => model.sup_Product.Price)%>
        </div>
        <div class="editor-label">
            <%: Html.Label("Image") %>
        </div>
        <div class="editor-field">
             <input id="Image" name="Image" type="file" />
             <img src="<%: Model.sup_Product.Image %>" alt="" title="" border="0" />
        </div>
        <div class="editor-field">
            <%: Html.Label("Active") %>
        </div>
        <div class="editor-field">
            <%: Html.CheckBox("sup_Product.Active", Model.sup_Product.Active)%>
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
    </form>
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
